<script setup>
import son from './Son.vue'
import Daughter from "./Daughter.vue";
import {ref} from "vue";

const money = ref(1000)
const sonRef = ref()

const borrow = () => {
  sonRef.value.borrow(50)
  money.value += 50
}

defineExpose({
  money
})

</script>

<template>
  <div class="box">
    我是父亲曹操,我有{{ money }}元
    <button @click="borrow">找我儿子曹植V我50元吃kfc</button>
    <son ref="sonRef"></son>
    <daughter></daughter>
  </div>
</template>

<style scoped>
.box {
  width: 100vw;
  height: 800px;
  background-color: greenyellow;
}
</style>
